package 数组0508.删除排序数组中的重复项0508;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;



//客户端
public class TopServeDemo01 {
    public static void main(String []args){

        Socket a=null;
        OutputStream w=null;
        try{
            InetAddress sIP=InetAddress.getByName("127.0.0.1");
            int port=7879;
            //创建一个socket的连接
            a=new Socket(sIP,port);
            //发送消息  IO流
            w=a.getOutputStream();
            w.write("你好,欢迎来".getBytes());
        }
        catch(Exception e){
            e.printStackTrace();
        }finally{
            if(w!=null){
                try {
                    w.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            if(a!=null){
                try {
                    a.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
    }
}
